Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Factory.php #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Patrick-ChStudio
Copy link

Raven is really cool.
It that might happen that, when an api evolves, some deprecated infos remain in its response. What is really top on XML is the XSD, which checks the structure of the data. Json des not have something like XSD. From openApi we can extract a structure definition. Why not using it to check an api response object's structure? This is basically the goal of those changes, allowing the reference structure tree to be used externally. It could be further used to check json response structure conformity. Not talking about values here, but properties being present or not, tested or ignored.

Raven is really cool.
It that might happen that, when an api evolves, some deprecated infos remain in its response.
What is really top on XML is the XSD, which checks the structure of the data. Json des not have something like XSD.
From openApi we can extract a structure definition. Why not using it to check an api response object's structure?
This is basically the goal of those changes, allowing the reference structure tree to be used externally.
It could be further used to check json response structure conformity. Not talking about values here, but properties being present or not, tested or ignored.
Copy link
Member

@shulard shulard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the proposal (and sorry for the delay 😞), if we go this way, I suggest having a specific object to extract the structure based on the schema. This structure must be represented as an object. Let's discuss my little comment about the PathFinder then we can move forward!

* One usage can be to further process the resulting array
* in order to check an api json response object's structure conformity
*/
public function getReferenceStructure(string $method, string $uri, int $statusCode, ?string $contentType): ?array
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that method recreating the League\OpenAPIValidation\PSR7\PathFinder logic ? This object is able to retrieve (based on method and uri) a list of available operations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants